import java.util.Scanner;

public class Borrow implements func {
    public void work(BookList bookList) {
        System.out.println("借图书");
        System.out.println("请输入要借图书名字");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        int size = bookList.getSize();
        for (int i = 0; i < size; i++) {
            if (name.equals(bookList.books[i].getName())) {
                System.out.println("借书成功");

                bookList.books[i].setGive(true);
                System.out.println(bookList.books[i]);
                return;
            }

        }
        System.out.println("该书不存在");
    }
}
